package com.zxj.schoolxianyu.service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.zxj.schoolxianyu.dao.followDao;
import com.zxj.schoolxianyu.entity.follow;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class getFollowStateService {
    @Autowired(required = false)
    private followDao followDao;

    public String getFollowState(String fromusername, String tousername) {
        EntityWrapper<follow> f = new EntityWrapper<>();
        f.eq("fromusername", fromusername);
        f.eq("tousername", tousername);
        List<follow> fs = followDao.selectList(f);
        if (fs.isEmpty()) return "false";
        else return "true";
    }
}
